#-*- coding:utf-8 -*-
from PIL import Image



def img2ico(src_img:str,des_img:str,size:tuple=(128,128)):
    """

    :param src_img: 原图片路径
    :param des_img: 转换的ico路径，需要以.ico结尾
    :param size:
    :return:
    """
    img = Image.open(src_img).convert('RGBA')
    img.save(des_img, format='ICO', sizes=[size])



def img2icns(src_img:str,des_img:str,size:tuple=(128,128)):
    """

    :param src_img: 原图片路径
    :param des_img: 转换的ico路径，需要以.ico结尾
    :param size:
    :return:
    """
    img = Image.open(src_img).convert('RGBA')
    img.save(des_img, format='ICNS', sizes=[size])